package com.exception.java;

public class Employee {
public int NumberOfWorkHours;
public String FirstName;
public String LastName;
public int Id;
public String EmployeeType;
public double HourPay;
public double WeekSalary;
public double Sales;

public int getNumberOfWorkHours(){
	return NumberOfWorkHours;
}
public void setNumberOfWorkHours( int NumberOfWorkHours){
	this.NumberOfWorkHours = NumberOfWorkHours;
}
public String getFirstName() {
	return FirstName;
}
public void setFirstName(String firstName) {
	FirstName = firstName;
}
public String getLastName() {
	return LastName;
}
public void setLastName(String lastName) {
	LastName = lastName;
}
public int getId() {
	return Id;
}
public void setId(int id) {
	Id = id;
}
public double getHourPay() {
	return HourPay;
}
public void setHourPay(double hourPay) {
	HourPay = hourPay;
}
public double getSales() {
	return Sales;
}
public void setSales(double sales) {
	Sales = sales;
}
public void WeekSalary() throws Exception{

	if(EmployeeType == "FullTime"){
		if(NumberOfWorkHours==0)
	{
		throw new Exception("You entered Number Of Work Hours as Zero");
	}
	
	else{
		WeekSalary = NumberOfWorkHours * HourPay;
		//System.out.println("");
	}
	}
	
	else if(EmployeeType =="Commission"){
		if(Sales==0){
			throw new Exception("You entered Sales as Zero\n");
		}
		else{
		WeekSalary = Sales * 0.35;
		//System.out.println("");
	}
}
	else if(EmployeeType =="PartTime"){
		if(NumberOfWorkHours <=40){
			WeekSalary = NumberOfWorkHours * HourPay;
			}
		else{
			System.out.println("He is Not Suppossed to work More than 40 Hours a Week.");
		}
	}
		else{
			System.out.println("No Records Found");
		}
	}
public String getEmployeeType() {
	return EmployeeType;
}
public void setEmployeeType(String employeeType) {
	EmployeeType = employeeType;
}
public void Display(){
	System.out.println("**********Employee Details**********");
	System.out.println("Week Salary is-- "+WeekSalary);
	
}


}
